
subjectList = {...
    'N072912R'...
    'A080512A'...
    'K091412S'...
    'M101012R'...
    'R091412V'...
    };

f_thresh = -Inf;
analysesDir = '/Volumes/cluster/jet/mattar/AdaptID/Analyses/';
FFAcontrast = 2; %1 for Faces-Objects, 2 for Faces-Scenes

numSubjects = length(subjectList);

distributionOfBetas = cell(1,numSubjects);

for subjIndx = 1:numSubjects
    [averageBetas maskedBetas averageBetasMatrix stdBetasMatrix] = extractROImask(subjectList{subjIndx}, f_thresh, FFAcontrast, analysesDir);
    if size(maskedBetas,1) == 3
        distributionOfBetas{1,subjIndx} = [maskedBetas{1,1}; maskedBetas{2,1}; maskedBetas{3,1}];
    else
        distributionOfBetas{1,subjIndx} = [maskedBetas{1,1}; maskedBetas{2,1}; maskedBetas{3,1}; maskedBetas{4,1}];
    end
end

for subjIndx = 1:numSubjects
    subplot(1,numSubjects,subjIndx);
    %hist(distributionOfBetas{1,subjIndx},-140:10:150);
    histfit(distributionOfBetas{1,subjIndx})
    axis([-150 150 0 400])
    title(subjectList{subjIndx});
end